---
title: Nodes
sidebar_label: Nodes
---

By default, vcluster will create fake nodes for every pod `spec.nodeName` it encounters within the virtual cluster. It will also create a fake kubelet endpoint for each node that will forward requests to the actual node or rewrite them to preserve virtual cluster names.

### Node Syncing Modes

Vcluster supports multiple modes to customize node syncing behaviour:
- **Fake Nodes** (default): vcluster will create fake nodes for each `spec.nodeName`. If there are no more pods on a node, the fake node will be deleted (no cluster role for vcluster is needed)
- **Real Nodes** (--fake-nodes=false): vcluster will copy and sync real nodes information for each `spec.nodeName`. If there are no more pods on a node within vcluster, the virtual cluster node will be deleted. Vcluster needs permission to the host cluster nodes, you can enable this via `vcluster create ... --create-cluster-role`
- **Real Nodes All** (--fake-nodes=false --sync-all-nodes): vcluster will always sync all nodes from the host cluster to the vcluster, no matter where pods are running. This is useful if you want to use DaemonSets within the vcluster. Vcluster needs permission to the host cluster nodes, you can enable this via `vcluster create ... --create-cluster-role`
- **Real Nodes Label Selector** (--fake-nodes=false --node-selector label1=value1): vcluster will only sync nodes that match the given label selector. You can also specify `--enforce-node-selector` to enforce scheduling only on these nodes. Vcluster needs permission to the host cluster nodes, you can enable this via `vcluster create ... --create-cluster-role`

### Example Sync All Nodes

For example, if you want to create a vcluster that syncs all nodes from the host cluster, you can create a file `values.yaml`:

```yaml
rbac:
  clusterRole:
    create: true

syncer:
  extraArgs: ["--fake-nodes=false", "--sync-all-nodes"]
```

Then you can create the vcluster with:

```yaml
vcluster create my-vcluster -n my-vcluster -f values.yaml
```
